/*
 * @Author: chen haoxuan
 * @Date: 2021-06-28 22:10:02
 * @LastEditTime: 2021-06-28 22:47:28
 */
#include<iostream>
using namespace std;
class Base
{
  public:
    Base(int x1):b(x1)
    {
      cout<<"constructor Base!"<<b<<endl;
    }
  private:
    int b;
};
class Derived1:virtual public Base
{
  public:
    Derived1(int x1,int x2):Base(x1),d1(x2)
    {
      cout<<"constructor Derived1!"<<d1<<endl;
    }
  private:
   int d1;
};
class Derived2:virtual public Base
{
  public:
    Derived2(int x1,int x2):Base(x1),d2(x2)
    {
      cout<<"constructor Derived2!"<<d2<<endl;
    }
  private:
   int d2;
};
class Derived3:public Derived1,public Derived2
{
  public:
    Derived3(int x1,int x2,int x3,int x4):Base(x1),Derived1(x1,x2),Derived2(x1,x2)
    {
      d3=x4;
      cout<<"constructor Derived3!"<<d3<<endl;
    }
  private:
    int d3;
};
int main()
{
  Derived1 a(1,2);
  Derived2 *p=new Derived3(3,4,5,6);
  return 0;
}
/*
    constructor Base!1 
    constructor Derived1!2
    constructor Base!3
    constructor Derived1!4
    constructor Derived2!5
    constructor Derived3!6
*/